package com.jwell.panrank.model

import com.jwell.driverapp.tools.BaseSubscriber
import com.jwell.panrank.application.App
import com.jwell.panrank.contract.WaybillContract
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import java.io.Serializable

/**
 * Created by 76577 on 2018/6/11.
 * 运单列表
 */
class WaybillModel : WaybillContract.Model, BaseModel() {
    override fun searchListData(searchData: RequestData, baseSubscriber: BaseSubscriber) {
        if (App.DEBUG) println("获取运单数据:" + searchData)
        getApiStore().getForExportWaybillPage(searchData)
                .subscribeOn(Schedulers.io())
                .unsubscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(baseSubscriber)
    }

    data class RequestData(
            var measurementTypeList: List<Int>? = null,
            var billStateList: List<Int>? = null,
            var planCode: String? = null,
            var forBillCode: String? = null,
            var supplierName: String? = null,
            var forwardingUnit: String? = null,
            var receivingUnit: String? = null,
            var mtrlOrderNo: String? = null,
            var materialName: String? = null,
            var driverName: String? = null,
            var carNum: String? = null,
            var createUserName: String? = null,
            var unloadPoint: String? = null,
            var planId: Int? = null,
            var maxResultCount: Int? = null,
            var skipCount: Int? = null,
            var filter: String? = null,
            var billState: Int? = null,
            var stateDate: String? = null,
            var endDate: String? = null,
            var planStartDate: String? = null,
            var planEndDate: String? = null,
            var feedingStartTime: String? = null,
            var waitTime: Int? = null,
            var feedingEndTime: String? = null,
            var samplingStartTime: String? = null,
            var remark: String? = null,
            var samplingEndTime: String? = null) : Serializable
}